<template>
    <div class="trend_header">
        <div class="league" style="user-select: text">{{monitorState.chartmodule.match.minfo?.league_name || '--'}}({{monitorState.chartmodule.match.minfo?.match_time || '--'}})</div>
        <div class="home_away">
            <div style="user-select: text">{{monitorState.chartmodule.match.minfo?.home_name || '--'}}</div>
            <img src="@/assets/monitor/vs.png" style="width: 16px;height: 16px;margin: 0 8px" alt="">
            <div style="user-select: text">{{monitorState.chartmodule.match.minfo?.away_name || '--'}}</div>
        </div>
        <div class="buttons">
            <div v-if="!monitorState.chartmodule.match.ids" style="opacity: .5;pointer-events: none;">收藏</div>
            <div v-else @click="monitorStore.clickCollect(monitorState.chartmodule.match)">收藏</div>
        </div>
    </div>
</template>

<script setup>
const { monitorStore, monitorState } = inject('MonitorStore')
</script>

<style lang="scss" scoped>

.trend_header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;

    .league {
        font-size: 14px;
        color: #000;
    }

    .home_away {
        display: flex;
        align-items: center;

        font-size: 14px;
        font-weight: 600;
        color: #000;
    }

    .buttons {
        div {
            width: 64px;
            height: 24px;
            background-color: #e92937;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            color: #fff;
            cursor: pointer;
        }
    }
}
</style>